import React, { memo } from 'react';
import { Form, Input, Button, Row, Col, Card } from 'antd';
import styles from './Analysis.less';
import { Pie } from '@/components/Charts';

const SearchInput = Form.create()(props => {
  // const { getFieldDecorator } = props.form;
  return (
    <Form layout="inline">
      <Form.Item label="项目查询">
        <Input />
      </Form.Item>
      <Form.Item>
        <Button type="primary" htmlType="submit">
          查询
        </Button>
      </Form.Item>
    </Form>
  );
});

const ProportionSales = memo(
  ({ dropdownGroup, salesType, loading, salesPieData, handleChangeSalesType }) => (
    <Card
      loading={loading}
      className={styles.salesCard}
      bordered={false}
      title="进度跟踪"
      bodyStyle={{ padding: 24 }}
      // extra={
      //   <div className={styles.salesCardExtra}>
      //     {dropdownGroup}
      //     <div className={styles.salesTypeRadio}>
      //       <Radio.Group value={salesType} onChange={handleChangeSalesType}>
      //         <Radio.Button value="all">
      //           代办业务
      //         </Radio.Button>
      //         <Radio.Button value="online">
      //           代办审批
      //         </Radio.Button>
      //         <Radio.Button value="stores">
      //           会议审批
      //         </Radio.Button>
      //       </Radio.Group>
      //     </div>
      //   </div>
      // }
      // style={{ marginTop: 24 }}
    >
      {/*<h4 style={{ marginTop: 10, marginBottom: 32 }}>
        进度跟踪
      </h4>*/}
      <Row style={{ marginTop: 12, padding: '20px 0', textAlign: 'center' }}>
        <Col span={24}>
          <SearchInput />
        </Col>
      </Row>
      <Row style={{ marginTop: 12 }}>
        <Col span={8}>
          <Pie
            animate={false}
            percent={28}
            subTitle="项目申报"
            total="28"
            height={160}
            lineWidth={2}
          />
        </Col>
        <Col span={8}>
          <Pie
            animate={false}
            color="#5DDECF"
            percent={22}
            subTitle="项目生效"
            total="22"
            height={160}
            lineWidth={2}
          />
        </Col>
        <Col span={8}>
          <Pie
            animate={false}
            color="#2FC25B"
            percent={32}
            subTitle="在保阶段"
            total="32"
            height={160}
            lineWidth={2}
          />
        </Col>
      </Row>
    </Card>
  ),
);

export default ProportionSales;
